<style type="text/css">
    .form-horizontal .form-group{
        margin-left: 0px;
        margin-right: 0px;
    }
</style>
<script src="/js/searchAdvanced.js?{echo time()}" type="text/javascript"></script>
<form role="form" class="form-horizontal" id="formSearch" method="post" style="height: 500px">
    <input type="hidden" name="shopname" value="$shop->URL" id="shopname">
    <div class="form-group" >
        <label class="col-lg-4" for="inputProductName" >Podaj Nazwę Produktu</label>
        <input name="inputProductName" class="col-lg-4 input-sm" type="text" id="inputProductName" placeholder="Podaj Nazwę Produktu">          
    </div> 
    <br/>
    <div class="form-group" id="manufacturers">
        <label class="bold col-lg-4" style="font-weight: bold" for="active">Wybierz Producenta</label>
        <div id="editProducer" class="col-lg-5" style="margin-left: -15px"> 
            <div class="btn-group" role="group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
                    wybierz<span class="caret"></span>
                </button>
                <ul class="dropdown-menu " role="menu">
                    {foreach $manufacturer in  $manufacturers}
                    <li><input type="hidden" name="manufacturer" value="$manufacturer->ManufacturerID"><a>$manufacturer->Name</a></li>
                    {/foreach}
                </ul>
            </div>
            <p class="alert-danger" style="padding-left: 10px">
                {if isset($errors)}
                {echo \view\View::showErrors($errors, "ManufacturerID")}  
                {/if}
            </p>
        </div>
    </div>
    <div class="form-group">
        <label for="active" class="bold col-lg-4" style="font-weight: bold" for="active">Tylko dostępne (ilość >0)</label>
        <input type="checkbox" name="active" id="active">                        
    </div>
    <div class="form-group">
        <p class="bold col-lg-4">Cena</p>
        <label for="priceFrom" class="bold col-xs-1" style="margin-left: -15px">od</label>  
        <input name="priceFrom" class="col-lg-4 input-sm" type="number" id="priceFrom" min="0" step="0.01" style="width: 90px">
        <label for="priceTo" class="bold col-xs-1">do</label>  
        <input name="priceTo" class="col-lg-4 input-sm" type="number" id="priceTo" min="0" step="0.01" style="width: 90px">
    </div>
    <div class="form-group mt10">
        <p class="bold col-lg-4">Wybierz kategorię</p>
        <div class="form-group" id="categories">
            <div id="editCategory" class="col-lg-7"> 
                <div class="btn-group" role="group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                        wybierz<span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu " role="menu" id="categoriesList">
                        {foreach $category in  $categories}
                        <li style="margin-left: {echo $category->Depth*10 }px">
                            <input type="hidden" name="category" value="$category->CategoryID" disabled>
                            <a>$category->Name</a>
                        </li>
                        {/foreach}
                    </ul>
                </div>
                <p class="alert-danger" style="padding-left: 10px">
                    {if isset($errors)}
                    {echo \view\View::showErrors($errors, "CategoryID")}   
                    {/if}
                </p>
            </div>
        </div>
    </div>
     <button type="submit" class="btn btn-info">Szukaj</button>
</form>
